<?php

class odcf_acl extends Zend_Acl {
    
    function __construct(){
        //$acl = new Zend_Acl();
        
        $this->addRole(new Zend_Acl_Role('guest'));
        $this->addRole(new Zend_Acl_Role('client'),'guest');//le client a les droits des guest plus les siens
        $this->addRole(new Zend_Acl_Role('admin'),'client');//l'admin a les droits des client plus les siens
        
        $this->addResource(new Zend_Acl_Resource('index'));
        $this->addResource(new Zend_Acl_Resource('installer'));
        $this->addResource(new Zend_Acl_Resource('articles'));
        $this->addResource(new Zend_Acl_Resource('clients'));
        $this->addResource(new Zend_Acl_Resource('frontclient'));
        $this->addResource(new Zend_Acl_Resource('commandes'));
        $this->addResource(new Zend_Acl_Resource('error'));
        $this->addResource(new Zend_Acl_Resource('outils'));
        $this->addResource(new Zend_Acl_Resource('deconnexion'));

        
        // Guest a le droit à :
        $this->allow('guest', 'index');
        $this->allow('guest', 'installer');
        
        // client a le droit à :
        $this->allow('client', 'frontclient');
        $this->allow('client', 'deconnexion');
        
        // admin a le droit à :
        $this->allow('admin', 'articles');
        $this->allow('admin', 'clients');
        $this->allow('admin', 'frontclient');
        $this->allow('admin', 'commandes');
        $this->allow('admin', 'error');
        $this->allow('admin', 'outils');
    }
}
